<?php
class ModelToolOplog extends Model {
	/**
	 * 取日志总数
	 */
	public function getTotalLogs() {
		$sql = $this->db->query("SELECT count(*) FROM op_log");
		return $sql->row;
	}
	/**
	 * 取日志
	 * @param unknown_type $page
	 * @param unknown_type $limit
	 */
	public function getLogs($page, $limit) {
		$start = ($page - 1) * $limit;
		$sql = $this->db->query("SELECT * FROM op_log ORDER BY id DESC LIMIT {$start},{$limit}");
		return $sql->rows;
	}
}
?>